---
title: Async Agent with Tools
---

## Code

```python cookbook/models/cometapi/async_tool_use.py
"""
Async tool use example using CometAPI.
"""

import asyncio

from agno.agent import Agent
from agno.models.cometapi import CometAPI
from agno.tools.duckduckgo import DuckDuckGoTools

agent = Agent(
    model=CometAPI(id="gpt-5"),
    tools=[DuckDuckGoTools(enable_search=True, enable_news=True)],
    markdown=True,
)

# Async tool use
asyncio.run(agent.aprint_response("What's the latest news about AI?"))

```

## Usage

<Steps>
  <Snippet file="create-venv-step.mdx" />

<Step title="Set your API key">```bash export COMETAPI_KEY=xxx ```</Step>

<Step title="Install libraries">
  ```bash pip install -U agno openai ddgs ```
</Step>

  <Step title="Run Agent">
    <CodeGroup>
    ```bash Mac
    python cookbook/models/cometapi/async_tool_use.py
    ```

    ```bash Windows
    python cookbook/models/cometapi/async_tool_use.py
    ```
    </CodeGroup>

  </Step>
</Steps>
